package com.school;

import java.util.Scanner;

public class Test2Case1 {
    public static void main(String[] args) {
        /*给定两个字符串A和B
         * A的旋转操作将最左边的字符移动到最右边
         * 若在若干次调整之后，A能变成B，那么返回True
         * 否则返回False*/
        String A, B;
        Scanner sc = new Scanner(System.in);
        A = sc.next();
        B = sc.next();
        boolean flage=check(A,B);
        System.out.println(flage);

    }


    public static boolean check(String A,String B){
        for (int i = 0; i <A.length() ; i++) {
            A=move(A);
            if(A.equals(B)){
               return true;
            }
        }
        return false;
    }
    public static String move(String A) {
        char str1=A.charAt(0);
        String str2=A.substring(1);
//revers()方法是将字符串内所有字符倒序
        return str2+str1;
    }

}